// wx.request()请求封装
function http(http_option) {
  return new Promise((resolve, reject) => {
    wx.request({
      url: http_option.url,
      data: http_option.data || {},
      method: http_option.method || 'get',
      success: resolve,
      fail: reject
    })
  })
}
// 请求后获取的数据截取需要的
function res_data(data) {
  let result = JSON.parse(data.substr(1, data.length - 2))
  return result.lists
}
//导出方法
module.exports = {
  http,
  res_data
}